.TH E1432_SET_AVG_WEIGHT 3 E1432
.SH NAME
.nf
e1432_set_avg_weight \- Set average weight
e1432_get_avg_weight \- Get average weight
.fi
.IX e1432_set_avg_weight(3) 3
.IX e1432_get_avg_weight(3) 3
.SH SYNOPSIS
.cS
SHORTSIZ16 e1432_set_avg_weight(E1432ID hw, SHORTSIZ16 ID,
                               SHORTSIZ16 weight)
SHORTSIZ16 e1432_get_avg_weight(E1432ID hw, SHORTSIZ16 ID,
                               SHORTSIZ16 *weight)
.cE
.SH DESCRIPTION
\fIe1432_set_avg_weight\fR sets the weight factor for the weighted average
mode, \fBE1432_AVG_EXPO\fR, set by the \fRe1432_set_avg_mode\fR function.
At this time
averaging is only allowed on the frequency data that results from the FFT 
calculations which are turned on using \fIe1432_set_calc_data\fR 
with the \fBE1432_DATA_FREQ\fR parameter.  Averaging allows the data from multiple 
scans to be averaged together before being uploaded to the host computer.
This method both reduces noise on the data and reduces the amount of data
uploaded to the host.  The averaging update rate is set with the 
\fIe1432_set_avg_update\fR function.  The total number of scans in an average is
set by \fIe1432_set_avg_number\fR.

\fIe1432_get_avg_weight\fR returns the average weight factor.

This parameter is a "global" parameter.  It applies to an entire E1432
module rather than to one of its channels.  The \fIID\fR parameter is
used only to identify which module the function applies to, and all
channels in that module will report the same value for this parameter.

\fIhw\fR must be the result of a successful call to
\fIe1432_assign_channel_weights\fR, and specifies the group of
hardware to talk to.

\fIID\fR is either the ID of a group of channels that was obtained with a
call to \fIe1432_create_channel_group\fR, or the ID of a single channel.

\fIweight\fR selects the weight factor for the average.  The algorithm for therate
weighted average is:

result = new point		for n = 1 (first point)

result(n) = (((weight - 1.0) * result(n-1)) + new point) / weight  for n = 2 -> N

where n = point number in the average and  N = total number in the average.

.SH "RESET VALUE"
After a reset, \fIweight\fR is set to \fB1.0\fR.
.SH "RETURN VALUE"
Return 0 if successful, a (negative) error weight otherwise.
.SH "SEE ALSO"
.na
e1432_set_avg_mode, e1432_set_avg_number, e1432_set_avg_update, 
e1432_set_calc_data
.ad
